<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="application/javascript" src="../js/angular-1.4.1/angular.js"></script>
</head>
<body ng-app="myApp">

<div ng-controller="MyController">
    <input type="text" ng-model="empName"/>
    <p>名字1:{{empName}}</p>
</div>
<div ng-controller="MyController2">
    <input type="text" ng-model="empName"/>
    <p>名字2:{{empName}}</p>
</div>

<script type="application/javascript">
    // var myModule = angular.module("myApp", []);
    //
    // myModule.controller("MyController", function ($scope) {
    //     $scope.empName = "Kobe";
    // });
    // myModule.controller("MyController2", function ($scope) {
    //     $scope.empName = "WADE";
    // })
    //myApp是模块的名字
    var myModule = angular.module("myApp", [])
        //这个形参$scope是固定的，不能改变
        .controller("MyController", function ($scope) {
            $scope.empName = "Kobe";
        })
        .controller("MyController2", function ($scope) {
            $scope.empName = "WADE";
        });
</script>
</body>
</html>